package xkp.lesson1;

public class Person {
	private int age;
	private String name;
	
	public String birthday;

	public Person() {
		System.out.println("public Person()");
	}

	private Person(int age) {
		System.out.println("private Person(int age) ");
		this.age = age;
	}

	protected Person(String name) {
		System.out.println("protected Person(String name)");
		this.name = name;
	}

	public Person(int age, String name) {
		//当使用super调用父类的构造方法是必须放在第一行
		//构造方法的调用必须在另外一个构造方法的第一行
		super();
		System.out.println("public Person(int age, String name)");

		this.age = age;
		this.name = name;
	}

	public int getAge() {

		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "Person [age=" + age + ", name=" + name + "]";
	}

	public void fun1() {

	}

	public void fun1(String name) {
		System.out.println("**********"+name);
	}

	private void fun1(int age,String name) {
		System.out.println(age+"---"+name);
	}

	public void show1(String s){
		System.out.println("调用了：公有的，String参数的show1(): s = " + s);
	}
	protected void show2(){
		System.out.println("调用了：受保护的，无参的show2()");
	}
	void show3(){
		System.out.println("调用了：默认的，无参的show3()");
	}
	private String show4(int age){
		System.out.println("调用了，私有的，并且有返回值的，int参数的show4(): age = " + age);
		return "abcd";
	}
}
